using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using buildingLib.human;
namespace _dmis.human
{
    public partial class EmployeeEdit : UIToolBase
    {
        Employee m_employee;
        public EmployeeEdit(Employee employee,string title)
        {
            InitializeComponent();
            this.Text = title;
            m_employee = employee;
            gendersBindingSource.DataSource = buildingLib.Genders.GetGenders();
            employeeBindingSource.DataSource = m_employee;
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {

        }

        private void btn_OK_Click(object sender, EventArgs e)
        {
            if (m_employee.IsValid)
            {
                this.DialogResult = DialogResult.OK;
                employeeBindingSource.EndEdit();
            }
        }
    }
}